home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
language
/
osbind.arc
/
osbind.h
next >
Wrap
C/C++ Source or Header
|
1989-03-29
|
23KB
|
907 lines
/*
* $Log: osbind.h,v $
* Revision 1.2 89/03/08 22:18:03 bammi
* Many hacks etc. Version as distributed with gcc V1.34
*
*
*/
/*
* OSBIND.H Mnemonic names for operating system calls
*
* Adapted from Dale Schumacher's version to Mark Johnson C by Eric Gisin.
*/
/* hacked by jrd for GNU */
/*
* more hacks
* inline the traps
*
* ++jrb bammi@dsrgsun.ces.cwru.edu
*/
#ifdef __STDC__
#ifndef __NO_PROTO__
static long trap_1_w(short);
static long trap_1_ww(short, short);
static long trap_1_wl(short, long);
static long trap_1_wlw(short, long, short);
static long trap_1_wwll(short, short, long, long);
static long trap_1_wlww(short, long, short, short);
static long trap_1_www(short, short, short);
static long trap_1_wll(short, long, long);
static long trap_1_wwlll(short, short, long, long, long);
static long trap_13_wl(short, long);
static long trap_13_w(short);
static long trap_13_ww(short, short);
static long trap_13_www(short, short, short);
static long trap_13_wwlwww(short, short, long, short, short, short);
static long trap_13_wwl(short, short, long);
static long trap_14_wwll(short, short, long, long);
static long trap_14_ww(short, short);
static long trap_14_w(short);
static long trap_14_wllw(short, long, long, short);
static long trap_14_wl(short, long);
static long trap_14_www(short, short, short);
static long trap_14_wllwwwww(short, long, long, short, short, short, short, short);
static long trap_14_wllwwwwlw(short, long, long, short, short, short, short, long, short);
static long trap_14_wwwwwww(short, short, short, short, short, short, short);
static long trap_14_wlll(short, long, long, long);
static long trap_14_wllww(short, long, long, short, short);
static long trap_14_wwwwl(short, short, short, short, long);
#endif
#endif
/*
* GEMDOS (trap1)
*/
#define Pterm0() \
(void)trap_1_w((short)(0x00))
#define Cconin() \
(long)trap_1_w((short)(0x01))
#define Cconout(c) \
(void)trap_1_ww((short)(0x02),(short)(c))
#define Cauxin() \
(short)trap_1_w((short)(0x03))
#define Cauxout(c) \
(void)trap_1_ww((short)(0x04),(short)(c))
#define Cprnout(c) \
(void)trap_1_ww((short)(0x05),(short)(c))
#define Crawio(data) \
(long)trap_1_ww((short)(0x06),(short)(data))
#define Crawcin() \
(long)trap_1_w((short)(0x07))
#define Cnecin() \
(long)trap_1_w((short)(0x08))
#define Cconws(s) \
(void)trap_1_wl((short)(0x09),(char *)(s))
#define Cconrs(buf) \
(void)trap_1_wl((short)(0x0A),(char *)(buf))
#define Cconis() \
(short)trap_1_w((short)(0x0B))
#define Dsetdrv(d) \
(long)trap_1_ww((short)(0x0E),(short)(d))
#define Cconos() \
(short)trap_1_w((short)(0x10))
#define Cprnos() \
(short)trap_1_w((short)(0x11))
#define Cauxis() \
(short)trap_1_w((short)(0x12))
#define Cauxos() \
(short)trap_1_w((short)(0x13))
#define Dgetdrv() \
(short)trap_1_w((short)(0x19))
#define Fsetdta(dta) \
(void)trap_1_wl((short)(0x1A),(void *)(dta))
#define Super(ptr) \
(long)trap_1_wl((short)(0x20),(void *)(ptr))
#define Tgetdate() \
(short)trap_1_w((short)(0x2A))
#define Tsetdate(date) \
(short)trap_1_ww((short)(0x2B),(short)(date))
#define Tgettime() \
(short)trap_1_w((short)(0x2C))
#define Tsettime(time) \
(short)trap_1_ww((short)(0x2D),(short)(time))
#define Fgetdta() \
(long)trap_1_w((short)(0x2F))
#define Sversion() \
(short)trap_1_w((short)(0x30))
#define Ptermres(save,rv) \
(void)trap_1_wlw((short)(0x31),(long)(save),(short)(rv))
#define Dfree(buf,d) \
(void)trap_1_wlw((short)(0x36),(void *)(buf),(short)(d))
#define Dcreate(path) \
(short)trap_1_wl((short)(0x39),(char *)(path))
#define Ddelete(path) \
(short)trap_1_wl((short)(0x3A),(char *)(path))
#define Dsetpath(path) \
(short)trap_1_wl((short)(0x3B),(char *)(path))
#define Fcreate(fn,mode) \
(short)trap_1_wlw((short)(0x3C),(char *)(fn),(short)(mode))
#define Fopen(fn,mode) \
(short)trap_1_wlw((short)(0x3D),(char *)(fn),(short)(mode))
#define Fclose(handle) \
(short)trap_1_ww((short)(0x3E),(short)(handle))
#define Fread(handle,cnt,buf) \
(long)trap_1_wwll((short)(0x3F),(short)(handle), \
(long)(cnt),(char *)(buf))
#define Fwrite(handle,cnt,buf) \
(long)trap_1_wwll((short)(0x40),(short)(handle), \
(long)(cnt),(char *)(buf))
#define Fdelete(fn) \
(short)trap_1_wl((short)(0x41),(char *)(fn))
#define Fseek(where,handle,how) \
(long)trap_1_wlww((short)(0x42),(long)(where), \
(short)(handle),(short)(how))
#define Fattrib(fn,rwflag,attr) \
(short)trap_1_wlww((short)(0x43),(char *)(fn), \
(short)(rwflag),(short)(attr))
#define Fdup(handle) \
(short)trap_1_ww((short)(0x45),(short)(handle))
#define Fforce(Hstd,Hnew) \
(short)trap_1_www((short)(0x46),(short)(Hstd),(short)(Hnew))
#define Dgetpath(buf,d) \
(void)trap_1_wlw((short)(0x47),(char *)(buf),(short)(d))
#define Malloc(size) \
(long)trap_1_wl((short)(0x48),(long)(size))
#define Mfree(ptr) \
(short)trap_1_wl((short)(0x49),(void *)(ptr))
#define Mshrink(ptr,size) \
(short)trap_1_wll((short)(0x4A),(short)0,(void *)(ptr),(long)(size))
#define Pexec(mode,prog,tail,env) \
(short)trap_1_wwlll((short)(0x4B),(short)(mode),(char *)(prog), \
(char *)(tail),(char *)(env))
#define Pterm(rv) \
(void)trap_1_ww((short)(0x4C),(short)(rv))
#define Fsfirst(filespec,attr) \
(short)trap_1_wlw((short)(0x4E),(char *)(filespec),(short)(attr))
#define Fsnext() \
(short)trap_1_w((short)(0x4F))
#define Frename(zero,old,new) \
(short)trap_1_wwll((short)(0x56),(short)(zero), \
(char *)(old),(char *)(new))
#define Fdatime(timeptr,handle,rwflag) \
(void)trap_1_wlww((short)(0x57),(long)(timeptr), \
(short)(handle),(short)(rwflag))
/* codes for Pexec */
#define PE_LOADGO 0 /* load & go */
#define PE_LOAD 1 /* just load */
#define PE_CBASEPAGE 2 /* just create basepage */
#define PE_GO 3 /* just go */
/*
* BIOS (trap13)
*/
#define Getmpb(ptr) \
(void)trap_13_wl((short)(0x00),(void *)(ptr))
#define Bconstat(dev) \
(short)trap_13_ww((short)(0x01),(short)(dev))
#define Bconin(dev) \
(long)trap_13_ww((short)(0x02),(short)(dev))
#define Bconout(dev,c) \
(void)trap_13_www((short)(0x03),(short)(dev),(short)((c) & 0xFF))
#define Rwabs(rwflag,buf,n,sector,d) \
(short)trap_13_wwlwww((short)(0x04),(short)(rwflag),(void *)(buf), \
(short)(n),(short)(sector),(short)(d))
#define Setexc(vnum,vptr) \
(void (*)())trap_13_wwl((short)(0x05),(short)(vnum),(void (*)())(vptr))
#define Tickcal() \
(long)trap_13_w((short)(0x06))
#define Getbpb(d) \
(void *)trap_13_w((short)(0x07),(short)(d))
#define Bcostat(dev) \
(short)trap_13_ww((short)(0x08),(short)(dev))
#define Mediach(dev) \
(short)trap_13_ww((short)(0x09),(short)(dev))
#define Drvmap() \
(long)trap_13_w((short)(0x0A))
#define Getshift() \
(short)trap_13_w((short)(0x0B))
#if 0 /* huh ? */
#define Kbshift(data) \
trap_13_ww((short)(0x0B),(short)(data))
#endif
/*
* XBIOS (trap14)
*/
#define Initmous(type,param,vptr) \
(void)trap_14_wwll((short)(0x00),(short)(type), \
(void *)(param),(void *)(vptr))
#define Ssbrk(size) \
(void *)trap_14_ww((short)(0x01),(short)(size))
#define Physbase() \
(void *)trap_14_w((short)(0x02))
#define Logbase() \
(void *)trap_14_w((short)(0x03))
#define Getrez() \
(short)trap_14_w((short)(0x04))
#define Setscreen(lscrn,pscrn,rez) \
(void)trap_14_wllw((short)(0x05),(void *)(lscrn),(void *)(pscrn), \
(short)(rez))
#define Setpallete(palptr) \
(void)trap_14_wl((short)(0x06),(void *)(palptr))
#define Setcolor(colornum,mixture) \
(short)trap_14_www((short)(0x07),(short)(colornum),(short)(mixture))
#define Floprd(buf,x,d,sect,trk,side,n) \
(short)trap_14_wllwwwww((short)(0x08),(void *)(buf),(long)(x), \
(short)(d),(short)(sect),(short)(trk),(short)(side),(short)(n))
#define Flopwr(buf,x,d,sect,trk,side,n) \
(short)trap_14_wllwwwww((short)(0x09),(void *)(buf),(long)(x)